﻿Public Class ExemploNegoc
    Implements IExemploNegoc


    Private _academicoNegocio As AcademicoNegocio
    Public Property AcademicoNegocio() As AcademicoNegocio
        Get
            Return _academicoNegocio
        End Get
        Set(ByVal value As AcademicoNegocio)
            _academicoNegocio = value
        End Set
    End Property


    Private _financeiroNegocio As FinanceiroNegocio
    Public Property FinanceiroNegocio() As FinanceiroNegocio
        Get
            Return _financeiroNegocio
        End Get
        Set(ByVal value As FinanceiroNegocio)
            _financeiroNegocio = value
        End Set
    End Property


    Private _contratoNegocio As ContratoNegocio
    Public Property ContratoNegocio() As ContratoNegocio
        Get
            Return _contratoNegocio
        End Get
        Set(ByVal value As ContratoNegocio)
            _contratoNegocio = value
        End Set
    End Property



    Public Function Matricular(ByVal _pessoa As Pessoa, ByVal _codigoTurma As String) As Aluno

        Dim _turma As Turma
        Dim _aluno As Aluno

        _turma = Me.AcademicoNegocio.BuscarTurma(_codigoTurma)
        _aluno = Me.AcademicoNegocio.MatricularNovoAluno(_pessoa, _turma)
        Me.AcademicoNegocio.CriarAmbienteVirtual(_aluno)

        Return _aluno

    End Function

    Public Function EmitirContrato(ByVal _aluno As Aluno, ByVal _plano As PlanoFinanceiro) As Contrato

        Dim _turma As Turma
        Dim _dadosFinanceiros As DadosFinanceiros
        Dim _template As TemplateContrato
        Dim _contrato As Contrato

        _turma = Me.AcademicoNegocio.BuscarTurma(_aluno)
        _dadosFinanceiros = Me.FinanceiroNegocio.BuscarDadosFinanceiros(_aluno)
        _template = Me.ContratoNegocio.BuscarTemplate(_turma, _plano)

        _contrato = Me.ContratoNegocio.EscreverContrato(_template, _dadosFinanceiros)

        Return _contrato

    End Function

End Class


Public Class Turma

End Class

Public Class Contrato

End Class

Public Class TemplateContrato

End Class

Public Class DadosFinanceiros

End Class


Public Class Pessoa

End Class

Public Class PlanoFinanceiro

End Class

Public Class Aluno

End Class

Public Interface AcademicoNegocio

    Function BuscarTurma(ByVal _codigo As String) As Turma

    Function BuscarTurma(ByVal _aluno As Aluno) As Turma

    Function MatricularNovoAluno(ByVal _pessoa As Pessoa, ByVal _turma As Turma) As Aluno

    Sub CriarAmbienteVirtual(ByVal _aluno As Aluno)

End Interface

Public Interface FinanceiroNegocio

    Function BuscarDadosFinanceiros(ByVal _aluno As Aluno) As DadosFinanceiros

End Interface

Public Interface ContratoNegocio

    Function BuscarTemplate(ByVal _turma As Turma, ByVal _plano As PlanoFinanceiro) As TemplateContrato

    Function EscreverContrato(ByVal _template As TemplateContrato, ByVal _dadosFinanceiros As DadosFinanceiros) As Contrato

End Interface


